import java.util.Random;

/**
 * @author: macy
 * @Email: 420534221@qq.com
 * @Date: 2020/8/15
 * @describe:  Socket 演示
 */
public class Demo {


    public static void main(String[] arem){
        test1();
    }


    private static void test1(){
        try{

            MySocketClient client=new MySocketClient("10.192.84.41",19730);

            System.out.println("Socket 连接成功");

            client.sendMsgToServer("发给服务端的随机数:"+Math.random());
            System.out.println("Socket 发送一次 心跳包");

            System.out.println("监听消息已注册");
            client.recMsgFromServer();

        }catch (Exception e){
            System.out.println("Socket 连接失败:"+e.getMessage());
        }
    }


}
